package com.captainbank.tcl.tclapplication.ui.activity.function;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.widget.LinearLayout;

import com.captainbank.tcl.tclapplication.R;
import com.captainbank.tcl.tclapplication.ui.activity.basic.BaseActivity;
import com.just.agentweb.AgentWeb;
import com.just.agentweb.AgentWebView;

import butterknife.BindView;

/**
 * Created by TCL on 2019/6/6.
 * Describe:
 */
public class AgentwebActivity extends BaseActivity {
    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindView(R.id.ll_webview)
    LinearLayout llWebview;

    private AgentWeb mAgentWeb;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_agentweb;
    }

    @Override
    protected void initView() {
        toolbar.setTitle(getString(R.string.title_agentweb));

        mAgentWeb = AgentWeb.with(this)//传入Activity
                .setAgentWebParent(llWebview, new LinearLayout.LayoutParams(-1, -1))//传入AgentWeb 的父控件 ，如果父控件为 RelativeLayout ， 那么第二参数需要传入 RelativeLayout.LayoutParams
                .useDefaultIndicator(getResources().getColor(R.color.colorAccent),3)// 使用默认进度条
//                .setReceivedTitleCallback(mCallback) //设置 Web 页面的 title 回调
                .createAgentWeb()//
                .ready()
//                .go("http://www.joinzs.com/");
                .go("http://html5test.com");
//                .go("https://test-cloud-wlz-com.oss-cn-shanghai.aliyuncs.com/report/Research/1554961218984_hh.pdf");
    }

}
